from dnsToIp import HTTPClient

running = 1;

'''
while running :
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM);
    url = raw_input('Input your URL: \n');
    host = getIp(url);
    port = 80;
    recBuffer = 4096;
    print '[Debug]: host = %r  port = %r ' % (host, port);
    sock.connect((host,port)); 
  
    sendMsg = raw_input('Input your message:\n');
    if sendMsg == 'end':
        break;
    
    sendMsg = construct_content(host=url);
    print sendMsg;
    sock.send(sendMsg);

    recv = sock.recv(recBuffer);
    print 'Server said: %s' % recv;
    
    sock.close()

'''
while running:
  url = raw_input('Input your URL: \n');
  try:
    client = HTTPClient(url);
    client.request('GET')
    client.get_all_response()
   # client.get_header_response()
  except:
    continue

